<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';
$zbp->Load();
$action='root';
if (!$zbp->CheckRights($action)) {$zbp->ShowError(6);die();}
if (!$zbp->CheckPlugin('SearchKeywords')) {$zbp->ShowError(48);die();}

$blogtitle='搜索词记录统计';
require $blogpath . 'zb_system/admin/admin_header.php';
require $blogpath . 'zb_system/admin/admin_top.php';
?>
<div id="divMain">
  <div class="divHeader"><?php echo $blogtitle;?></div>
  <div class="SubMenu">
  </div>
  <div id="divMain2">
<!--代码-->
<?php
//echo GetGuestAgent();
$p=new Pagebar('{%host%}zb_users/plugin/SearchKeywords/main.php?{&page=%page%}',false);
$p->PageCount=60; //每页显示的行数
$p->PageNow=(int)GetVars('page','GET')==0?1:(int)GetVars('page','GET');
$p->PageBarCount=$zbp->pagebarcount;
$order = array('t_ID' => 'DESC');
$sql= $zbp->db->sql->Select(
$SearchKeywords_Table,
        '*',
        null,
        $order,
	array(($p->PageNow-1) * $p->PageCount,$p->PageCount),
	array('pagebar'=>$p)
);
$array=$zbp->GetListCustom($SearchKeywords_Table,$SearchKeywords_DataInfo,$sql);
?><style type="text/css">
table {table-layout:fixed;}
td {white-space:nowrap;overflow:hidden;}
</style>
<a href="del_all.php" >删除全部数据！</a>
    <table border="1" class="tableFull tableBorder table_striped table_hover">
        <thead>
            <tr>
            	<th style="width:5%;text-align:center"><b>编号</b></th>
            	<th style="width:25%;text-align:center"><b>关键词</b></th>
            	<th style="width:20%;text-align:center"><b>IP地址</b></th>
            	<th style="width:25%;text-align:center"><b>UserAgent</b></th>
            	<th style="width:20%;text-align:center"><b>时间</b></th>
            	<th style="text-align:center"><b>操作</b></th>
            </tr>
        </thead>
        <tbody>
            <?php
            foreach ($array as $key => $value) {
            ?>
            <tr>
                <td>
                    <?php echo $value->ID ?>
                </td>
                <td>
                    <?php echo $value->Keyword ?>
                </td>
                <td>
                    <?php echo $value->IP ?>
                </td>
                <td>
                    <?php echo $value->UA ?>
                </td>
                <td>
                    <?php echo SearchKeywords_TimeAgo(date("Y-m-d H:i:s",$value->Time)) ?>
                </td>
                <td>
                    <a href="del.php?id=<?php echo $value->ID ?>"><img src="../../../zb_system/image/admin/delete.png"/></a>
                </td>
            </tr>
            <?php 
            } ?>
        </tbody>
    </table>
  </div>
  <?php
              		echo  '<p class="pagebar">';

                    foreach ($p->buttons as $key => $value) {
                    	echo '<a href="'. $value .'">' . $key . '</a>&nbsp;&nbsp;' ;
                    }
                    
                    echo  '</p>'; ?>
</div>

<?php
require $blogpath . 'zb_system/admin/admin_footer.php';
RunTime();
?>